<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>sunJsona的个人博客</title>

  <!-- keywords -->
  

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="雅戈尔OA系统 工号: 1234# npm&amp;amp;yarn 换源&amp;amp;命令删除node_modules 1.查看当前源npmyarn config get registry2、切换为淘宝源yarnnpm config set registry https://registry.npm.taobao.org3、或者切换为自带的npmyarn config set registry https:">
<meta property="og:type" content="article">
<meta property="og:title" content="sunJsona的个人博客">
<meta property="og:url" content="https://xiaochangzai.github.io/2020/07/07/公司内部笔记/index.html">
<meta property="og:site_name" content="sunJsona的个人博客">
<meta property="og:description" content="雅戈尔OA系统 工号: 1234# npm&amp;amp;yarn 换源&amp;amp;命令删除node_modules 1.查看当前源npmyarn config get registry2、切换为淘宝源yarnnpm config set registry https://registry.npm.taobao.org3、或者切换为自带的npmyarn config set registry https:">
<meta property="og:locale" content="Simple Chinese">
<meta property="og:updated_time" content="2020-07-07T05:00:13.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="sunJsona的个人博客">
<meta name="twitter:description" content="雅戈尔OA系统 工号: 1234# npm&amp;amp;yarn 换源&amp;amp;命令删除node_modules 1.查看当前源npmyarn config get registry2、切换为淘宝源yarnnpm config set registry https://registry.npm.taobao.org3、或者切换为自带的npmyarn config set registry https:">
  
    <link rel="alternative" href="/atom.xml" title="sunJsona的个人博客" type="application/atom+xml">
  
  
    <link rel="icon" href="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg">
  
  <link rel="stylesheet" href="/css/style.css">
  
  

  <script src="//cdn.bootcss.com/require.js/2.3.2/require.min.js"></script>
  <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>

  
</head>
<body>
  <div id="container">
    <div id="particles-js"></div>
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
			<img lazy-src="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" class="js-avatar">
			
		</a>

		<hgroup>
		  <h1 class="header-author"><a href="/">sunJsona</a></h1>
		</hgroup>

		

		
			<div class="switch-btn">
				<div class="icon">
					<div class="icon-ctn">
						<div class="icon-wrap icon-house" data-idx="0">
							<div class="birdhouse"></div>
							<div class="birdhouse_holes"></div>
						</div>
						<div class="icon-wrap icon-ribbon hide" data-idx="1">
							<div class="ribbon"></div>
						</div>
						
						<div class="icon-wrap icon-link hide" data-idx="2">
							<div class="loopback_l"></div>
							<div class="loopback_r"></div>
						</div>
						
						
					</div>
					
				</div>
				<div class="tips-box hide">
					<div class="tips-arrow"></div>
					<ul class="tips-inner">
						<li>菜单</li>
						<li>标签</li>
						
						<li>友情链接</li>
						
						
					</ul>
				</div>
			</div>
		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/">主页</a></li>
				        
							<li><a href="/archives">所有文章</a></li>
				        
						</ul>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
						</div>
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						
					</div>
				</section>
				
				
				
				<section class="switch-part switch-part3">
					<div id="js-friends">
					
			          <a target="_blank" class="main-nav-link switch-friends-link" href="https://github.com/smackgg/hexo-theme-smackdown">smackdown</a>
			        
			        </div>
				</section>
				

				
			</div>
		</div>
	</header>				
</div>
    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide">sunJsona</h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
				<img lazy-src="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" class="js-avatar">
			</div>
			<hgroup>
			  <h1 class="header-author">sunJsona</h1>
			</hgroup>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/">主页</a></li>
		        
					<li><a href="/archives">所有文章</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
				</div>
			</nav>
		</header>				
	</div>
</nav>
      <div class="body-wrap"><article id="post-公司内部笔记" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2020/07/07/公司内部笔记/" class="article-date">
  	<time datetime="2020-07-07T05:00:13.000Z" itemprop="datePublished">2020-07-07</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><a href="http://192.168.188.111/login/Login.jsp?logintype=1" target="_blank" rel="noopener">雅戈尔OA系统</a></p>
<p>工号: <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># npm&amp;yarn 换源&amp;命令删除node_modules</span><br></pre></td></tr></table></figure></p>
<p>1.查看当前源<br>npm<br>yarn config get registry<br>2、切换为淘宝源<br>yarn<br>npm config set registry <a href="https://registry.npm.taobao.org" target="_blank" rel="noopener">https://registry.npm.taobao.org</a><br>3、或者切换为自带的<br>npm<br>yarn config set registry <a href="https://registry.yarnpkg.com" target="_blank" rel="noopener">https://registry.yarnpkg.com</a><br>4、删除 node_modules<br> 安装 rimraf<br> npm install rimraf -g<br>使用命令删除<br>rimraf node_modules<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">#### 本地排程号-工厂</span><br></pre></td></tr></table></figure></p>
<p>西服：2019-J502<br>时装：2020-TX<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">liantong_0518</span><br><span class="line"></span><br><span class="line">```home.vue</span><br></pre></td></tr></table></figure></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br></pre></td><td class="code"><pre><span class="line">&lt;template&gt;</span><br><span class="line">  &lt;div class=&quot;container&quot;&gt;</span><br><span class="line">    &lt;div class=&quot;screen-container&quot;&gt;</span><br><span class="line">      &lt;van-swipe-cell</span><br><span class="line">        v-for=&quot;(item, index) in screenList&quot;</span><br><span class="line">        :disabled=&quot;!item.hasEnter&quot;</span><br><span class="line">        :key=&quot;index&quot;&gt;</span><br><span class="line">        &lt;van-row</span><br><span class="line">          :class=&quot;`screenItem $&#123;Number(screenIndex) === index ? &apos;screenActive&apos; : &apos;&apos;&#125;`&quot;</span><br><span class="line">          @click=&quot;screenChange(item, index)&quot;</span><br><span class="line">        &gt;</span><br><span class="line">          &lt;van-col class=&quot;content&quot;&gt;</span><br><span class="line">            &lt;p&gt;&#123;&#123; item.scrname &#125;&#125;&lt;/p&gt;</span><br><span class="line">            &lt;p&gt;编号：&#123;&#123; item.scrid &#125;&#125;&lt;/p&gt;</span><br><span class="line">            &lt;p v-if=&quot;item.createtime&quot;&gt;创建时间：&#123;&#123; item.createtime.slice(0,10) &#125;&#125;&lt;/p&gt;</span><br><span class="line">          &lt;/van-col&gt;</span><br><span class="line">          &lt;van-col class=&quot;content&quot;&gt;</span><br><span class="line">            &lt;img :src=&quot;require(`@/assets/$&#123;item.scrid&#125;.png`)&quot; alt=&quot;&quot;&gt;</span><br><span class="line">          &lt;/van-col&gt;</span><br><span class="line">        &lt;/van-row&gt;</span><br><span class="line">        &lt;template #right&gt;</span><br><span class="line">          &lt;van-button square text=&quot;进入控制台&quot; type=&quot;info&quot; class=&quot;to-ctrl&quot;  @click=&quot;toControl(item), screenChange(item, index)&quot;/&gt;</span><br><span class="line">        &lt;/template&gt;</span><br><span class="line">      &lt;/van-swipe-cell&gt;</span><br><span class="line">      &lt;!-- &lt;div class=&quot;btn&quot; @touchstart.prevent=&quot;startTouch&quot; @touchend.prevent=&quot;touchEnd&quot;&gt;测试语音&lt;/div&gt; --&gt;</span><br><span class="line">    &lt;/div&gt;</span><br><span class="line">    &lt;van-row class=&quot;posSelect&quot; @click=&quot;selectShow()&quot;&gt;切换地点&lt;/van-row&gt;</span><br><span class="line">      &lt;van-dialog</span><br><span class="line">        v-model=&quot;selectDialogShow&quot;</span><br><span class="line">        @confirm=&quot;dialogConfirmHandler&quot;</span><br><span class="line">        closeOnClickOverlay</span><br><span class="line">        :showConfirmButton=&quot;false&quot;</span><br><span class="line">        title=&quot;请选择&quot;</span><br><span class="line">      &gt;</span><br><span class="line">        &lt;div class=&quot;optionsWrap&quot;&gt;</span><br><span class="line">          &lt;div</span><br><span class="line">            :class=&quot;`posOption $&#123;deviceCode==index+1 ? &apos;isActive&apos; : &apos;&apos;&#125;`&quot;</span><br><span class="line">            v-for=&quot;(item, index) in screenPosList&quot;</span><br><span class="line">            :key=&quot;index&quot;</span><br><span class="line">            @click=&quot;screenSelect(index)&quot;</span><br><span class="line">          &gt;</span><br><span class="line">            &#123;&#123; item.name &#125;&#125;</span><br><span class="line">          &lt;/div&gt;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">      &lt;/van-dialog&gt;</span><br><span class="line">      &lt;!-- &lt;Loading ref=&quot;loading&quot; :visable=&quot;true&quot;/&gt; --&gt;</span><br><span class="line">  &lt;/div&gt;</span><br><span class="line">&lt;/template&gt;</span><br><span class="line"></span><br><span class="line">&lt;script&gt;</span><br><span class="line">import &#123; Button, Tabbar, TabbarItem, Swipe, SwipeCell, SwipeItem, Row, Col, Dialog &#125; from &apos;vant&apos;</span><br><span class="line">import * as dd from &apos;dingtalk-jsapi&apos;</span><br><span class="line">import &#123; getScreenList, changeScreen, getTokenByAuthCode &#125; from &apos;../api/dingdingApi&apos;</span><br><span class="line">// import Loading from &apos;components/Loading&apos;</span><br><span class="line"></span><br><span class="line">export default &#123;</span><br><span class="line">  name: &apos;home&apos;,</span><br><span class="line">  data () &#123;</span><br><span class="line">    return &#123;</span><br><span class="line">      selectDialogShow: false,</span><br><span class="line">      deviceCode: localStorage.getItem(&apos;DEVICE_CODE&apos;) || &apos;1&apos;,</span><br><span class="line">      screenIndex: localStorage.getItem(&apos;SCREEN_INDEX&apos;) || 0,</span><br><span class="line">      // 大屏物理地点</span><br><span class="line">      screenPosList: [</span><br><span class="line">        &#123;</span><br><span class="line">          name: &apos;A座大屏&apos;,</span><br><span class="line">          deviceCode: &apos;1&apos;,</span><br><span class="line">          isActive: true</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          name: &apos;B座博物馆&apos;,</span><br><span class="line">          deviceCode: &apos;2&apos;,</span><br><span class="line">          isActive: false</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          name: &apos;B座拼接屏&apos;,</span><br><span class="line">          deviceCode: &apos;3&apos;,</span><br><span class="line">          isActive: false</span><br><span class="line">        &#125;, &#123;</span><br><span class="line">          name: &apos;进入测试&apos;,</span><br><span class="line">          deviceCode: 100,</span><br><span class="line">          isActive: false</span><br><span class="line">        &#125;</span><br><span class="line">      ],</span><br><span class="line">      screenList: [</span><br><span class="line">        &#123;</span><br><span class="line">          screenId: 1,</span><br><span class="line">          scrid: 1,</span><br><span class="line">          name: &apos;设备互联调度中心&apos;,</span><br><span class="line">          num: &apos;20200429090807&apos;,</span><br><span class="line">          time: &apos;2020/4/29&apos;</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          screenId: 2,</span><br><span class="line">          scrid: 2,</span><br><span class="line">          name: &apos;产前调度中心&apos;,</span><br><span class="line">          num: &apos;20200429090807&apos;,</span><br><span class="line">          time: &apos;2020/4/29&apos;</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          screenId: 3,</span><br><span class="line">          scrid: 3,</span><br><span class="line">          name: &apos;车间订单调度中心&apos;,</span><br><span class="line">          num: &apos;20200429090807&apos;,</span><br><span class="line">          time: &apos;2020/4/29&apos;</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          screenId: 4,</span><br><span class="line">          scrid: 4,</span><br><span class="line">          name: &apos;智能产线调度中心&apos;,</span><br><span class="line">          num: &apos;20200429090807&apos;,</span><br><span class="line">          time: &apos;2020/4/29&apos;</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          screenId: 5,</span><br><span class="line">          scrid: 5,</span><br><span class="line">          name: &apos;生产通知调度大屏&apos;,</span><br><span class="line">          num: &apos;20200429090807&apos;,</span><br><span class="line">          time: &apos;2020/4/29&apos;</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          screenId: 6,</span><br><span class="line">          scrid: 6,</span><br><span class="line">          name: &apos;精益中心调度大屏&apos;,</span><br><span class="line">          num: &apos;20200429090807&apos;,</span><br><span class="line">          time: &apos;2020/4/29&apos;</span><br><span class="line">        &#125;</span><br><span class="line">      ]</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br><span class="line">  components: &#123;</span><br><span class="line">    [Button.name]: Button,</span><br><span class="line">    [Tabbar.name]: Tabbar,</span><br><span class="line">    [TabbarItem.name]: TabbarItem,</span><br><span class="line">    [Swipe.name]: Swipe,</span><br><span class="line">    [SwipeItem.name]: SwipeItem,</span><br><span class="line">    [Row.name]: Row,</span><br><span class="line">    [Col.name]: Col,</span><br><span class="line">    [Dialog.Component.name]: Dialog.Component,</span><br><span class="line">    // Loading: Loading,</span><br><span class="line">    [SwipeCell.name]: SwipeCell</span><br><span class="line">  &#125;,</span><br><span class="line">  mounted () &#123;</span><br><span class="line">    console.log(&apos; --- 进入Home ---&apos;)</span><br><span class="line"></span><br><span class="line">    if (localStorage.getItem(&apos;FIRST_ENTER&apos;) === &apos;true&apos; &amp;&amp; localStorage.getItem(&apos;DEVICE_CODE&apos;) === null) &#123;</span><br><span class="line">      this.selectDialogShow = true</span><br><span class="line">    &#125; else &#123;</span><br><span class="line">      this.selectDialogShow = false</span><br><span class="line">      try &#123;</span><br><span class="line">        document.title = this.screenPosList[localStorage.getItem(&apos;DEVICE_CODE&apos;) - 1].name + &apos;-控制器&apos;</span><br><span class="line">      &#125; catch (e) &#123; console.error(e) &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    console.log(&apos;deviceCode created:&apos;, localStorage.getItem(&apos;DEVICE_CODE&apos;))</span><br><span class="line">    if (process.env.NODE_ENV === &apos;development&apos;) &#123;</span><br><span class="line">      getScreenList().then(res =&gt; &#123;</span><br><span class="line">        this.screenList = res.data</span><br><span class="line">        for (let item of this.screenList) &#123;</span><br><span class="line">          item.imgUrl = &apos;p&apos; + item.scrid</span><br><span class="line">          item.hasEnter = ![20200521001, 20200521004, 20200521005].includes(item.scrid)</span><br><span class="line">        &#125;</span><br><span class="line">        const scrLoading = document.querySelector(&apos;#scr-loading&apos;)</span><br><span class="line">        setTimeout(() =&gt; &#123;</span><br><span class="line">          scrLoading.className = &apos;fade-hide&apos;</span><br><span class="line">        &#125;, 500)</span><br><span class="line">        setTimeout(() =&gt; &#123;</span><br><span class="line">          scrLoading.className = &apos;&apos;</span><br><span class="line">          scrLoading.style.display = &apos;none&apos;</span><br><span class="line">        &#125;, 1000)</span><br><span class="line">      &#125;)</span><br><span class="line">    &#125;</span><br><span class="line">    debugger</span><br><span class="line">    console.log(&apos;--- 正在添加token ---&apos;)</span><br><span class="line">    try &#123;</span><br><span class="line">      dd.runtime.permission.requestAuthCode(&#123;</span><br><span class="line">        corpId: &apos;ding93d89be042ee6abd35c2f4657eb6378f&apos;,</span><br><span class="line">        // corpId: &apos;ding9bf7f88c8bc0ced3ffe93478753d9884&apos;,</span><br><span class="line">        onSuccess: result =&gt; &#123;</span><br><span class="line">          console.log(result)</span><br><span class="line">          console.log(&apos;添加token成功&apos;, result)</span><br><span class="line">          getTokenByAuthCode(&#123;</span><br><span class="line">            requestAuthCode: result.code</span><br><span class="line">          &#125;).then(res =&gt; &#123;</span><br><span class="line">            console.log(&apos;getTokenByAuthCode 成功&apos;, res)</span><br><span class="line"></span><br><span class="line">            localStorage.setItem(&apos;TOKEN&apos;, res.data)</span><br><span class="line">            getScreenList().then(res =&gt; &#123;</span><br><span class="line">              this.screenList = res.data</span><br><span class="line">              for (let item of this.screenList) &#123;</span><br><span class="line">                item.imgUrl = &apos;p&apos; + item.scrid</span><br><span class="line">              &#125;</span><br><span class="line">            &#125;).catch(err =&gt; &#123;</span><br><span class="line">              alert(JSON.stringify(err))</span><br><span class="line">              console.log(&apos;=========================&gt;&apos;)</span><br><span class="line"></span><br><span class="line">              console.error(err)</span><br><span class="line">            &#125;)</span><br><span class="line">          &#125;).catch(err =&gt; &#123;</span><br><span class="line">            alert(&apos;getTokenByAuthCode 出错&apos;)</span><br><span class="line">            console.log(&apos;getTokenByAuthCode 出错&apos;, err)</span><br><span class="line">          &#125;)</span><br><span class="line">        /* &#123;</span><br><span class="line">        code: &apos;hYLK98jkf0m&apos; //string authCode</span><br><span class="line">    &#125; */</span><br><span class="line">        &#125;,</span><br><span class="line">        onFail: err =&gt; &#123;</span><br><span class="line">          console.log(&apos;添加token失败--&gt;&apos;, err)</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">      &#125;)</span><br><span class="line">    &#125; catch (error) &#123;</span><br><span class="line">      alert(&apos;添加token中途崩溃&apos;)</span><br><span class="line">      console.error(&apos;添加token中途崩溃&apos;)</span><br><span class="line">      console.error(error)</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br><span class="line">  beforeRouteEnter (to, from, next) &#123;</span><br><span class="line">    if (!from.name) &#123;</span><br><span class="line">      localStorage.setItem(&apos;FIRST_ENTER&apos;, true)</span><br><span class="line">    &#125; else &#123;</span><br><span class="line">      localStorage.setItem(&apos;FIRST_ENTER&apos;, false)</span><br><span class="line">    &#125;</span><br><span class="line">    next()</span><br><span class="line">  &#125;,</span><br><span class="line">  methods: &#123;</span><br><span class="line">    // 大屏地点选择</span><br><span class="line">    screenSelect (index) &#123;</span><br><span class="line">      console.log(typeof (index))</span><br><span class="line">      if (index === 3) &#123;</span><br><span class="line">        this.$router.push(&apos;/test&apos;)</span><br><span class="line">        return</span><br><span class="line">      &#125;</span><br><span class="line">      this.screenPosList.forEach(item =&gt; &#123;</span><br><span class="line">        item.isActive = false</span><br><span class="line">      &#125;)</span><br><span class="line">      this.screenPosList[index].isActive = true</span><br><span class="line">      this.deviceCode = this.screenPosList[index].deviceCode</span><br><span class="line">      localStorage.setItem(&apos;DEVICE_CODE&apos;, this.deviceCode)</span><br><span class="line">      document.title = this.screenPosList[index].name + &apos;-控制器&apos;</span><br><span class="line">      dd.biz.navigation.setTitle(&#123;</span><br><span class="line">        title: document.title, // 控制标题文本，空字符串表示显示默认文本</span><br><span class="line">        onSuccess: function (result) &#123;</span><br><span class="line">          console.log(&apos;设置title成功&apos;, result)</span><br><span class="line">        &#125;,</span><br><span class="line">        onFail: function (err) &#123;</span><br><span class="line">          console.error(&apos;设置title失败&apos;, err)</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;)</span><br><span class="line">      this.selectDialogShow = false</span><br><span class="line">    &#125;,</span><br><span class="line">    dialogConfirmHandler () &#123;</span><br><span class="line">      console.log(&apos;deviceCode:&apos;, this.deviceCode)</span><br><span class="line">      localStorage.setItem(&apos;DEVICE_CODE&apos;, this.deviceCode)</span><br><span class="line">      // this.selectDialogShow = true</span><br><span class="line">    &#125;,</span><br><span class="line">    // 切换地点按钮</span><br><span class="line">    selectShow () &#123;</span><br><span class="line">      this.selectDialogShow = true</span><br><span class="line">    &#125;,</span><br><span class="line">    screenChange (item, index) &#123;</span><br><span class="line">      this.screenIndex = index</span><br><span class="line">      localStorage.setItem(&apos;SCREEN_INDEX&apos;, this.screenIndex)</span><br><span class="line">      changeScreen(&#123;</span><br><span class="line">        deviceCode: this.deviceCode,</span><br><span class="line">        scrid: item.scrid</span><br><span class="line">      &#125;).then(res =&gt; &#123;</span><br><span class="line">        console.log(res)</span><br><span class="line">      &#125;)</span><br><span class="line">    &#125;,</span><br><span class="line">    toControl (item) &#123;</span><br><span class="line">      this.$router.push(&#123;</span><br><span class="line">        path: &apos;/control&apos;,</span><br><span class="line">        name: &apos;control&apos;,</span><br><span class="line">        query: &#123;</span><br><span class="line">          name: item.scrname,</span><br><span class="line">          scrid: item.scrid,</span><br><span class="line">          deviceCode: this.deviceCode,</span><br><span class="line">          respower: item.respower</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;)</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line">&lt;/script&gt;</span><br><span class="line">&lt;style lang=&quot;scss&quot; scoped&gt;</span><br><span class="line">.container&#123;</span><br><span class="line">  height: auto;</span><br><span class="line">  width: 100%;</span><br><span class="line">  padding-bottom: 50px;</span><br><span class="line">  .screen-container &#123;</span><br><span class="line">    height: 100%;</span><br><span class="line">    // background: red;</span><br><span class="line">    overflow: scroll;</span><br><span class="line">    .screenItem &#123;</span><br><span class="line">      width: 90%;</span><br><span class="line">      height: 120px;</span><br><span class="line">      margin: 10px auto;</span><br><span class="line">      border: 1px solid rgba(136, 136, 136, 0.1);</span><br><span class="line">      // box-shadow: 3px 3px 5px rgba(136, 136, 136, 0.2);</span><br><span class="line">      padding: 20px 15px;</span><br><span class="line">      box-sizing: border-box;</span><br><span class="line">      .content &#123;</span><br><span class="line">        height: 100%;</span><br><span class="line">        width: 50%;</span><br><span class="line">        position: relative;</span><br><span class="line">        .title &#123;</span><br><span class="line">          position: absolute;</span><br><span class="line">          width: 120px;</span><br><span class="line">          height: 30px;</span><br><span class="line">          text-align: center;</span><br><span class="line">          line-height: 30px;</span><br><span class="line">          right: 0;</span><br><span class="line">          top: 15px;</span><br><span class="line">          background: rgba(82, 79, 79, 0.8);</span><br><span class="line">          font-size: 16px;</span><br><span class="line">          color: #fff;</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">      .content:nth-child(1) &#123;</span><br><span class="line">        text-align: left;</span><br><span class="line">        p &#123;</span><br><span class="line">          margin: 0;</span><br><span class="line">        &#125;</span><br><span class="line">        p:nth-child(1) &#123;</span><br><span class="line">          color: #000;</span><br><span class="line">          font-size: 16px;</span><br><span class="line">          line-height: 22px;</span><br><span class="line">          margin-bottom: 4px;</span><br><span class="line">          // white-space: nowrap;</span><br><span class="line">          // text-overflow: ellipsis;</span><br><span class="line">          // overflow: hidden;</span><br><span class="line">        &#125;</span><br><span class="line">        p:nth-child(n + 2) &#123;</span><br><span class="line">          color: #9199A9!important;</span><br><span class="line">          font-size: 14px;</span><br><span class="line">          line-height: 20px;</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">      .content:nth-child(2) &#123;</span><br><span class="line">        text-align: right;</span><br><span class="line">        img &#123;</span><br><span class="line">          width: 120px;</span><br><span class="line">          height: 60px;</span><br><span class="line">          background: #000;</span><br><span class="line">          border-radius: 4px;</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    .to-ctrl &#123;</span><br><span class="line">      width: 80px;</span><br><span class="line">      height: 3.2rem;</span><br><span class="line">      line-height: 1.5;</span><br><span class="line">    &#125;</span><br><span class="line">    .screenActive &#123;</span><br><span class="line">      border-color: #3DD6F6;</span><br><span class="line">      background: url(&apos;../assets/icon_selected.png&apos;) bottom right no-repeat;</span><br><span class="line">      background-size: 10%;</span><br><span class="line">      border-radius: 3px;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">  // .btn&#123;</span><br><span class="line">  //   width: 300px;</span><br><span class="line">  //   background: red;</span><br><span class="line">  //   height: 100px;</span><br><span class="line">  // &#125;</span><br><span class="line">  .posSelect &#123;</span><br><span class="line">    width: 90%;</span><br><span class="line">    height: 40px;</span><br><span class="line">    background: #1487fb;</span><br><span class="line">    // border: 1px solid #1487fb;</span><br><span class="line">    border-radius: 20px;</span><br><span class="line">    position: fixed;</span><br><span class="line">    bottom: 15px;</span><br><span class="line">    left: 50%;</span><br><span class="line">    transform: translateX(-50%);</span><br><span class="line">    text-align: center;</span><br><span class="line">    line-height: 40px;</span><br><span class="line">    font-size: 16px;</span><br><span class="line">    color: #fff;</span><br><span class="line">  &#125;</span><br><span class="line">  .optionsWrap &#123;</span><br><span class="line">    width: 100%;</span><br><span class="line">    box-sizing: border-box;</span><br><span class="line">    padding: 10px 20px;</span><br><span class="line">    display: flex;</span><br><span class="line">    flex-wrap: wrap;</span><br><span class="line">    justify-content: space-between;</span><br><span class="line">    .posOption &#123;</span><br><span class="line">      width: 80px;</span><br><span class="line">      padding: 5px 25px;</span><br><span class="line">      color: #9199A9;</span><br><span class="line">      text-align: center;</span><br><span class="line">      border-radius: 25px;</span><br><span class="line">      margin-bottom: 10px;</span><br><span class="line">      border: 1px solid transparent;</span><br><span class="line">    &#125;</span><br><span class="line">    .isActive &#123;</span><br><span class="line">      border-color: #1487fb;</span><br><span class="line">      color: #1487fb;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line">&lt;/style&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">```javascript</span><br><span class="line">const path = require(&apos;path&apos;)</span><br><span class="line">const CompressionWebpackPlugin = require(&apos;compression-webpack-plugin&apos;)</span><br><span class="line">const UglifyjsWebpackPlugin = require(&apos;uglifyjs-webpack-plugin&apos;)</span><br><span class="line">const port = process.env.port || process.env.npm_config_port || 8888</span><br><span class="line">const cdnDomian = &apos;./&apos; // cdn域名，如果有cdn修改成对应的cdn</span><br><span class="line">const name = &apos;大屏控制器&apos; // page title</span><br><span class="line">const IS_PRODUCTION = process.env.NODE_ENV === &apos;production&apos;</span><br><span class="line">// dev环境接口地址</span><br><span class="line">let DEVE_MODE_REQUEST_URL = &apos;http://localhost:8080/&apos;</span><br><span class="line">if (process.argv[4] === &apos;test&apos;) &#123;</span><br><span class="line">// test环境接口地址</span><br><span class="line">  DEVE_MODE_REQUEST_URL = &apos;http://101.71.158.252:8888/&apos;</span><br><span class="line">&#125;</span><br><span class="line">const cdn = &#123;</span><br><span class="line">  css: [],</span><br><span class="line">  js: [</span><br><span class="line">    &apos;https://cdn.bootcss.com/vue/2.6.10/vue.min.js&apos;,</span><br><span class="line">    &apos;https://cdn.bootcss.com/vue-router/3.0.3/vue-router.min.js&apos;,</span><br><span class="line">    &apos;https://cdn.bootcss.com/vuex/3.1.0/vuex.min.js&apos;,</span><br><span class="line">    &apos;https://cdn.bootcss.com/axios/0.19.0-beta.1/axios.min.js&apos;,</span><br><span class="line">    &apos;https://cdn.bootcss.com/js-cookie/2.2.1/js.cookie.min.js&apos;</span><br><span class="line">  ]</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">const externals = &#123;</span><br><span class="line">  vue: &apos;Vue&apos;,</span><br><span class="line">  &apos;vue-router&apos;: &apos;VueRouter&apos;,</span><br><span class="line">  vuex: &apos;Vuex&apos;,</span><br><span class="line">  axios: &apos;axios&apos;,</span><br><span class="line">  &apos;js-cookie&apos;: &apos;Cookies&apos;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">function resolve (dir) &#123;</span><br><span class="line">  return path.join(__dirname, dir)</span><br><span class="line">&#125;</span><br><span class="line">console.log(&apos;process&apos;, process.argv[4])</span><br><span class="line">module.exports = &#123;</span><br><span class="line">  publicPath: IS_PRODUCTION ? cdnDomian : &apos;./&apos;,</span><br><span class="line">  outputDir: &apos;dist&apos;,</span><br><span class="line">  assetsDir: &apos;static&apos;,</span><br><span class="line">  lintOnSave: process.env.NODE_ENV === &apos;development&apos;,</span><br><span class="line">  productionSourceMap: false,</span><br><span class="line">  devServer: &#123;</span><br><span class="line">    port: port,</span><br><span class="line">    open: true,</span><br><span class="line">    overlay: &#123;</span><br><span class="line">      warnings: false,</span><br><span class="line">      errors: true</span><br><span class="line">    &#125;,</span><br><span class="line">    disableHostCheck: true,</span><br><span class="line">    proxy: &#123;</span><br><span class="line">      &apos;/sc_api&apos;: &#123;</span><br><span class="line">        target: DEVE_MODE_REQUEST_URL,</span><br><span class="line">        changeOrigin: true</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;,</span><br><span class="line">    after: require(&apos;./mock/mock-server.js&apos;)</span><br><span class="line">  &#125;,</span><br><span class="line">  configureWebpack: &#123;</span><br><span class="line">    // provide the app&apos;s title in webpack&apos;s name field, so that</span><br><span class="line">    // it can be accessed in index.html to inject the correct title.</span><br><span class="line">    name: name,</span><br><span class="line">    resolve: &#123;</span><br><span class="line">      alias: &#123;</span><br><span class="line">        &apos;@&apos;: resolve(&apos;src&apos;), // 主目录</span><br><span class="line">        &apos;views&apos;: resolve(&apos;src/views&apos;), // 页面</span><br><span class="line">        &apos;components&apos;: resolve(&apos;src/components&apos;), // 组件</span><br><span class="line">        &apos;api&apos;: resolve(&apos;src/api&apos;), // 接口</span><br><span class="line">        &apos;utils&apos;: resolve(&apos;src/utils&apos;), // 通用功能</span><br><span class="line">        &apos;assets&apos;: resolve(&apos;src/assets&apos;), // 静态资源</span><br><span class="line">        &apos;style&apos;: resolve(&apos;src/style&apos;) // 通用样式</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br><span class="line">  chainWebpack (config) &#123;</span><br><span class="line">    config.plugins.delete(&apos;preload&apos;) // TODO: need test</span><br><span class="line">    config.plugins.delete(&apos;prefetch&apos;) // TODO: need test</span><br><span class="line"></span><br><span class="line">    // set svg-sprite-loader</span><br><span class="line">    config.module</span><br><span class="line">      .rule(&apos;svg&apos;)</span><br><span class="line">      .exclude.add(resolve(&apos;src/icons&apos;))</span><br><span class="line">      .end()</span><br><span class="line">    config.module</span><br><span class="line">      .rule(&apos;icons&apos;)</span><br><span class="line">      .test(/\.svg$/)</span><br><span class="line">      .include.add(resolve(&apos;src/icons&apos;))</span><br><span class="line">      .end()</span><br><span class="line">      .use(&apos;svg-sprite-loader&apos;)</span><br><span class="line">      .loader(&apos;svg-sprite-loader&apos;)</span><br><span class="line">      .options(&#123;</span><br><span class="line">        symbolId: &apos;icon-[name]&apos;</span><br><span class="line">      &#125;)</span><br><span class="line">      .end()</span><br><span class="line"></span><br><span class="line">    // set preserveWhitespace</span><br><span class="line">    config.module</span><br><span class="line">      .rule(&apos;vue&apos;)</span><br><span class="line">      .use(&apos;vue-loader&apos;)</span><br><span class="line">      .loader(&apos;vue-loader&apos;)</span><br><span class="line">      .tap(options =&gt; &#123;</span><br><span class="line">        options.compilerOptions.preserveWhitespace = true</span><br><span class="line">        return options</span><br><span class="line">      &#125;)</span><br><span class="line">      .end()</span><br><span class="line"></span><br><span class="line">    config</span><br><span class="line">    // https://webpack.js.org/configuration/devtool/#development</span><br><span class="line">      .when(process.env.NODE_ENV === &apos;development&apos;,</span><br><span class="line">        config =&gt; config.devtool(&apos;cheap-source-map&apos;)</span><br><span class="line">      )</span><br><span class="line"></span><br><span class="line">    config</span><br><span class="line">      .when(process.env.NODE_ENV !== &apos;development&apos;,</span><br><span class="line">        config =&gt; &#123;</span><br><span class="line">          config</span><br><span class="line">            .plugin(&apos;ScriptExtHtmlWebpackPlugin&apos;)</span><br><span class="line">            .after(&apos;html&apos;)</span><br><span class="line">            .use(&apos;script-ext-html-webpack-plugin&apos;, [&#123;</span><br><span class="line">            // `runtime` must same as runtimeChunk name. default is `runtime`</span><br><span class="line">              inline: /runtime\..*\.js$/</span><br><span class="line">            &#125;])</span><br><span class="line">            .end()</span><br><span class="line">          config</span><br><span class="line">            .optimization.splitChunks(&#123;</span><br><span class="line">              chunks: &apos;all&apos;,</span><br><span class="line">              cacheGroups: &#123;</span><br><span class="line">                libs: &#123;</span><br><span class="line">                  name: &apos;chunk-libs&apos;,</span><br><span class="line">                  test: /[\\/]node_modules[\\/]/,</span><br><span class="line">                  priority: 10,</span><br><span class="line">                  chunks: &apos;initial&apos; // only package third parties that are initially dependent</span><br><span class="line">                &#125;,</span><br><span class="line">                commons: &#123;</span><br><span class="line">                  name: &apos;chunk-commons&apos;,</span><br><span class="line">                  test: resolve(&apos;src/components&apos;), // can customize your rules</span><br><span class="line">                  minChunks: 3, //  minimum common number</span><br><span class="line">                  priority: 5,</span><br><span class="line">                  reuseExistingChunk: true</span><br><span class="line">                &#125;</span><br><span class="line">              &#125;</span><br><span class="line">            &#125;)</span><br><span class="line">          config.optimization.runtimeChunk(&apos;single&apos;)</span><br><span class="line">        &#125;</span><br><span class="line">      )</span><br><span class="line">    if (IS_PRODUCTION) &#123;</span><br><span class="line">      config.plugin(&apos;html&apos;).tap(args =&gt; &#123;</span><br><span class="line">        args[0].cdn = cdn</span><br><span class="line">        return args</span><br><span class="line">      &#125;)</span><br><span class="line">      config.externals(externals)</span><br><span class="line">      config.plugin(&apos;html&apos;).tap(args =&gt; &#123;</span><br><span class="line">        args[0].minify.minifyCSS = true // 压缩html中的css</span><br><span class="line">        return args</span><br><span class="line">      &#125;)</span><br><span class="line">      // gzip需要nginx进行配合</span><br><span class="line">      config</span><br><span class="line">        .plugin(&apos;compression&apos;)</span><br><span class="line">        .use(CompressionWebpackPlugin)</span><br><span class="line">        .tap(() =&gt; [</span><br><span class="line">          &#123;</span><br><span class="line">            test: /\.js$|\.html$|\.css/, // 匹配文件名</span><br><span class="line">            threshold: 10240, // 超过10k进行压缩</span><br><span class="line">            deleteOriginalAssets: false // 是否删除源文件</span><br><span class="line">          &#125;</span><br><span class="line">        ])</span><br><span class="line">      config.optimization.minimizer([</span><br><span class="line">        new UglifyjsWebpackPlugin(&#123;</span><br><span class="line">          // 生产环境推荐关闭 sourcemap 防止源码泄漏</span><br><span class="line">          // 服务端通过前端发送的行列，根据 sourcemap 转为源文件位置</span><br><span class="line">          sourceMap: true,</span><br><span class="line">          uglifyOptions: &#123;</span><br><span class="line">            warnings: false,</span><br><span class="line">            compress: &#123;</span><br><span class="line">              drop_console: false,</span><br><span class="line">              drop_debugger: false</span><br><span class="line">            &#125;</span><br><span class="line">          &#125;</span><br><span class="line">        &#125;)</span><br><span class="line">      ])</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br><span class="line">  css: &#123;</span><br><span class="line">    // 是否使用css分离插件 ExtractTextPlugin</span><br><span class="line">    extract: !!IS_PRODUCTION,</span><br><span class="line">    // 开启 CSS source maps?</span><br><span class="line">    sourceMap: false,</span><br><span class="line">    // css预设器配置项</span><br><span class="line">    // 启用 CSS modules for all css / pre-processor files.</span><br><span class="line">    modules: false,</span><br><span class="line">    loaderOptions: &#123;</span><br><span class="line">      sass: &#123;</span><br><span class="line">        data: &apos;@import &quot;style/_mixin.scss&quot;;@import &quot;style/_variables.scss&quot;;@import &quot;style/common.scss&quot;;&apos; // 全局引入</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
      
    </div>
    
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2020/07/07/一些JS骚操作/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">&lt;</strong>
      <div class="article-nav-title">
        
          一些JS骚操作
        
      </div>
    </a>
  
  
    <a href="/2020/07/07/关于FAT32硬盘格式不支持cnpm的解决办法/" id="article-nav-older" class="article-nav-link-wrap">
      <div class="article-nav-title">关于FAT32硬盘格式不支持cnpm的解决办法</div>
      <strong class="article-nav-caption">&gt;</strong>
    </a>
  
</nav>

  
</article>


<div class="ds-share share" data-thread-key="公司内部笔记" data-title="" data-url="https://xiaochangzai.github.io/2020/07/07/公司内部笔记/"  data-images="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" data-content="">
    <div class="ds-share-inline">
      <ul  class="ds-share-icons-16">
      	<li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
        <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
        <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
        <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
        <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>
      </ul>
      <div class="ds-share-icons-more">
      </div>
    </div>
 </div>
 





</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
      <div class="footer-left">
        &copy; 2022 sunJsona
      </div>
        <div class="footer-right">
          <a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/smackgg/hexo-theme-smackdown" target="_blank">Smackdown</a>
        </div>
    </div>
  </div>
</footer>
    </div>
    
  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">


<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: true,
		animate: true,
		isHome: false,
		isPost: true,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>
<script src="/js/main.js"></script>



<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';                 
    }       
});
</script>

<script src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js"></script>


  </div>
</body>
</html>